<?php
/**
 * User: hufeng
 * Date: 2016/12/25
 * Desc：短信类库
 */
namespace App\Common\Util;

class RongCloud{
    public $rc;
    public function __construct(){
        require_once(BASEDIR.'/vendor/rongyun/rongcloud.php');
        $this->rc = new \RongCloud(RC_APPKEY,RC_APPSECRET);
    }

    //getToken
    public function getToken($uid,$uname,$avatar){
        $res = $this->rc->user()->getToken($uid,$uname,$avatar);
        return json_decode($res);
    }
    //refreshToken
    public function refreshToken($uid,$uname,$avatar){
        $this->rc->user()->refresh($uid,$uname,$avatar);
    }
}